FROM node:16.20.2 as build
RUN mkdir -p /dtc
WORKDIR /dtc
COPY ./ /dtc
RUN cd /dtc
RUN npm i --registry=https://registry.npmmirror.com/
RUN npm run build

# 运行时需要执行的指令
FROM nginx as runtime
COPY --from=build /dtc/dist /usr/share/nginx/html/
EXPOSE 80